package com.test4.bean;

/**
 * 天师
 *
 * @author Cc
 * 2024-03-12
 */
public class さふみ extends People implements Tool {
    private String toolName;

    {
        this.setName("八卦镜");
    }

    @Override
    public void openDoor(Door door) {
        if (door instanceof IronJadeDoor || door instanceof MahoganyDoor) {
            if (door instanceof IronJadeDoor) {
                ((IronJadeDoor) door).WardOffEvil();
            } else {
                ((MahoganyDoor) door).WardOffEvil();
            }
        } else {
            System.out.println("大威天龙");
        }
    }

    @Override
    public void closeDoor(Door door) {

    }

    @Override
    public String getToolName() {
        return this.toolName;
    }

    @Override
    public void setName(String value) {
        this.toolName = value;
    }

    @Override
    public void open(Door door) {
        openDoor(door);
    }
}
